﻿@using Entities
@model WebUI.Models.FilesModel
@{
    AjaxOptions ajaxOpts = new AjaxOptions
{
    UpdateTargetId = "RecordsGrid",
    InsertionMode = InsertionMode.Replace,
    LoadingElementId = "divLoading",
    OnSuccess = "initalizetooltip" //because html of grid is replaced, the attached events are gone, we have to reattach them with every post
};
}
<script type="text/javascript">
    function ToggleDiv() {
        var ele = document.getElementById("filterDiv");
        if (ele.style.display == "block") {
            ele.style.display = "none";
        }
        else {
            ele.style.display = "block";
        }
    }
</script>
@section Filters{
    <img alt="" src="@Links.Content.images.filter_jpg"  onclick="ToggleDiv();return false;"/>
    <div id="filterDiv" style="display: block">
        <div style="float: left">
            @using (Ajax.BeginForm(MVC.Reports.Reports.FilterReports(), ajaxOpts, new { id = "searchForm" }))
            {
                Html.RenderPartial(MVC.Reports.Shared.Views._Filters, Model.FilesFilter);
                Html.RenderPartial(MVC.Reports.Shared.Views._Columns, Model.Columns.Keys);
            }
        </div>
        <table>
            <tr>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td style="padding-top: 18px">
                    @{Html.RenderPartial(MVC.Reports.Filters.Views.FileTypes);}
                </td>
            </tr>
            <tr>
                <td style="padding-top: 3px">
                    @{Html.RenderPartial(MVC.Reports.Filters.Views.Hosts);}
                </td>
            </tr>
            <tr>
                <td style="padding-top: 3px">
                    @{Html.RenderPartial(MVC.Reports.Filters.Views.Policies);}
                </td>
            </tr>
            @if (Model.FilesFilter.RenderOperationTypes)
            {
                <tr>
                    <td style="padding-top: 3px">
                        @{Html.RenderPartial(MVC.Reports.Filters.Views.Operations);}
                    </td>
                </tr>
            }
        </table>
    </div>
}
@section Title{@Model.Title}
@section PageName{@Model.Title}
@section Buttons{
    <a href="#">
        <img alt="" src="@Links.Content.images.icon_info_png"
                            width="14" height="14" hspace="7" vspace="2" border="0" align="right" /></a><a href="#"><img
                                alt="" src="@Links.Content.images.icon_print_png" width="16" height="16" hspace="4"
                                border="0" align="right" /></a>}
<div id="divLoading" style="display: none; position: absolute; left: 50%; top: 50%;
    margin-left: -100px; margin-top: -100px">
    <img alt="" src="@Links.Content.images.loading_gif" />
</div>
<div id="RecordsGrid">
    @{Html.RenderPartial(MVC.Reports.Reports.Views._Records, Model);}
</div>
